<template>
<h1>{{info}}</h1>
  <input type="text" v-model="info">
  <h2>登录界面</h2>
  <input type="username" placeholder="请输入用户名" v-model="user.username">
  <input type="password" placeholder="请输入密码" v-model="user.password">
  <input type="button" value="登录" @click="login()">
</template>

<script setup>
import {ref} from "vue";

const info = ref('双向绑定');
const user = ref({username:"",password:""});
const login = () => {
  console.log(user.value.username+":"+user.value.password);
}
</script>

<style scoped>

</style>